execute if entity @s[gamemode=creative] run return fail
execute if data entity @s SelectedItem.components."minecraft:custom_data"{can_use_count:-1} run return fail

function dab:system/generic_bow/change_use_count/remove {value:1}

execute if data entity @s SelectedItem.components."minecraft:custom_data"{can_use_count:0} run function dab:system/generic_bow/durability/bow_break with entity @s SelectedItem.components."minecraft:custom_data".run

item modify entity @s weapon.mainhand dab:display_can_use/update

data remove storage dab:system temp.bow
scoreboard players reset #can_use_count temp